package com.richinfo.consumer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * 服务消费者
 * 
* Created by WangXJ
* 2018-10-30 14:56
*/
//@EnableCircuitBreaker//开启断路器
//@EnableDiscoveryClient
//@SpringBootApplication
@SpringCloudApplication//此注解包含上面三个注解
public class ConsumerApplication {

	private static Logger logger = LoggerFactory.getLogger(ConsumerApplication.class);
	
	@Bean
	@LoadBalanced
	RestTemplate restTemplate() {
		return new RestTemplate();
	}
	public static void main(String[] args) {
		SpringApplication.run(ConsumerApplication.class, args);
		
		logger.info("====== RIBBON CONSUMER START ======");
	}

}
